//新增文章(已检测)
const db=require("../lib/db")

function addArticle(title,content,desc,author,authorId,classify,time){
    return new Promise((resolve,reject)=>{
        let sql=`insert into article(title,content,\`desc\`,author,authorId,classify,time)values('${title}','${content}','${desc}','${author}',${authorId},'${classify}','${time}')`;
        console.log(sql)
        db.querySql(sql).then(data=>{
            if(data.length==0){
                resolve(404)
            }else{
                console.log(true)
                resolve(true)
            }
        })
    })
}

module.exports=addArticle